package com.android.topview.watermelon.account.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import com.android.topview.watermelon.account.fragment.CostFragment
import com.android.topview.watermelon.account.fragment.IncomeFragment

class AccountViewpagerAdapter(manager: FragmentManager) : FragmentStatePagerAdapter(manager) {

    override fun getCount() = 2

    private var mCostFragment:CostFragment  = CostFragment.newInstance()
    private var mIncomeFragment:IncomeFragment = IncomeFragment.newInstance()

    override fun getItem(position: Int): Fragment {
        return if (position == 0) {
            mCostFragment
        } else {
            mIncomeFragment
        }

    }

}